import com.adobe.cairngorm.control.CairngormEventDispatcher;

import net.optix.ip.events.SetCopyrightEvent;
import net.optix.ip.model.ModelLocator;
import net.optix.ip.vo.CopyrightVO;

[Bindable]
private var model:ModelLocator	=	ModelLocator.getInstance();

public function init():void
{
	model.bSubmit	=	true;
	model.result	=	"";
 	model.close		=	"no";
}
  			
private function changeDeath():void
{
	if(type.selectedIndex == 1)
	{
		deathInformation.visible	=	true;
	}
	else
	{
		deathInformation.visible	=	false;
	}
}

private function saveCopyRight():void
{
	var vo:CopyrightVO	=	new CopyrightVO();
	vo.clientID			=	model.client.clientID;
	vo.title	=	title.text;
	vo.created	=	created.text;
	vo.registered=	registered.text;
	vo.registration=registration.text;
	vo.issuedTo	=	issuedTo.text;
	vo.type		=	type.selectedIndex;
	vo.death	=	death.text;
	
	model.bSubmit	=	false;
	
	var event:SetCopyrightEvent	=	new SetCopyrightEvent(vo);
	com.adobe.cairngorm.control.CairngormEventDispatcher.getInstance().dispatchEvent(event);
}